package router

import (
	"ordersystem/controller"
	"ordersystem/middleware"

	"github.com/gofiber/fiber/v2"
)

func SetUserRouter(userRouter *fiber.Router) {

	var routerForUser = (*userRouter).Group("/user")

	// If check others's information, need to check permissions
	routerForUser.Post("/queryUser", controller.UserQueryUserController)
	routerForUser.Post("/delete", controller.UserDeleteUserController)
	routerForUser.Post("/update", controller.UserUpdateUserController)

	routerForAdmin := routerForUser.Group("/", middleware.UserAdminIdentifyCheckMiddleware)
	routerForAdmin.Post("/queryUsers", controller.UserQueryUsersController)
	routerForAdmin.Post("/queryUserNumber", controller.UserQueryNumberController)
	routerForAdmin.Post("/create", controller.UserCreateUserController)

}
